﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LibraryO2S;

public partial class Administrator_townadd : System.Web.UI.Page
{
    private TownController objTown = new TownController();
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        string name = txtName.Text.Trim();
        string index = txtIndex.Text.Trim();
        string status = "0";
        if (chkStatus.Checked == true)
        {
            status = "1";
        }
        int a = objTown.Insert(name, index, status);
        if (a > 0)
        {
            Response.Redirect("town.aspx");
        }
        else
        {
            divMessage.InnerHtml = O2S_Message.Warning("Cảnh Báo", "Thêm dữ liệu không thành công!");
        }
    }
}